  -    
         ( http://johncms.com),       (   "JohnCMS / Build 918")        [b][url=[/b]http://johncms.com[b]][/b]JohnCMS / Build 918[b][/url][/b]       [url=http://johncms.com]JohnCMS / Build 918[/url]

   incfiles/func.php   -  

[php]
function forum_link($m) {
    ////////////////////////////////////////////////////////////
    //             //
    //////////////////////////////////////////////////////////// 
    global $home;
    if (!isset ($m[3])) {
        return '[url=' . $m[1] . ']' . $m[2] . '[/url]';
    }
    else {
        if($cont = @file_get_contents($m[3])){
             preg_match('|<title>([^\<]+)<|Uis', $cont, $title);
             $title = htmlentities(trim($title[1]), ENT_QUOTES, 'UTF-8');
                                     
            if($title){
                if(mb_strlen($title) > 40)
                     $title = mb_substr($title, 0, 40) . '...';
                 return '[url=' . $m[3] . ']' . $title . '[/url]';
            }else
                 return $m[3];
        }else
             return $m[3];
    }
}
[/php]

// dakilla (clubjava.ru)